﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for cls_tbNHATKYLOP
/// </summary>
public class cls_tbNHATKYLOP
{
	public cls_tbNHATKYLOP()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    #region Select
    public static DataTable Select()
    {
        DataTable dt = new DataTable();
        DatabaseConnect connect = new DatabaseConnect();
        try
        {
            dt = connect.GetSelectCommand("tbNHATKYLOP_SELECT", null);
        }
        catch { }
        return dt;
    }
    public static DataTable GetByF_MACN(string F_MACN)
    {
        DataTable dt = new DataTable();
        DatabaseConnect connect = new DatabaseConnect();
        SqlParameter[] para = new SqlParameter[1];
        para[0] = new SqlParameter("@F_MACN", F_MACN);
        try
        {
            dt = connect.GetSelectCommand("tbNHATKYLOP_GetByF_MACN", para);
        }
        catch { }
        return dt;
    }
    #endregion

    #region Insert
    public static void Insert(string F_MALOP, int F_SISO, DateTime F_NGAYKG, string F_TGHOC, bool F_KT, string F_MACH, int F_THANGTHU, string F_TGTHUPHI, string F_MACN, int F_STTCAPLOP, string F_MAGV, DateTime F_NGAYBD, DateTime F_NGAYKT, string F_PHONGHOC, int F_MANV, string F_HANHDONG)
    {
        DatabaseConnect connect = new DatabaseConnect();
        // Tham so
        SqlParameter[] para = new SqlParameter[16];
        para[0] = new SqlParameter("@F_MALOP", F_MALOP);
        para[1] = new SqlParameter("@F_SISO", F_SISO);
        para[2] = new SqlParameter("@F_NGAYKG", F_NGAYKG);
        para[3] = new SqlParameter("@F_TGHOC", F_TGHOC);
        para[4] = new SqlParameter("@F_KT", F_KT);
        para[5] = new SqlParameter("@F_MACH", F_MACH);
        para[6] = new SqlParameter("@F_THANGTHU", F_THANGTHU);
        para[7] = new SqlParameter("@F_TGTHUPHI", F_TGTHUPHI);
        para[8] = new SqlParameter("@F_MACN", F_MACN);
        para[9] = new SqlParameter("@F_STTCAPLOP", F_STTCAPLOP);
        para[10] = new SqlParameter("@F_MAGV", F_MAGV);
        para[11] = new SqlParameter("@F_NGAYBD", F_NGAYBD);
        para[12] = new SqlParameter("@F_NGAYKT", F_NGAYKT);
        para[13] = new SqlParameter("@F_PHONGHOC", F_PHONGHOC);
        para[14] = new SqlParameter("@F_MANV", F_MANV);
        para[15] = new SqlParameter("@F_HANHDONG", F_HANHDONG);
        try
        {
            connect.ExecuteQuery("tbNHATKYLOP_INSERT", para);
        }
        catch { }
    }
    #endregion
    #region Insert log Xoa Lop
    public static void Insert_logXoaLop(string F_MALOP, int F_MANV, string F_HANHDONG)
    {
        DatabaseConnect connect = new DatabaseConnect();
        // Tham so
        SqlParameter[] para = new SqlParameter[3];
        para[0] = new SqlParameter("@F_MALOP", F_MALOP);
        para[1] = new SqlParameter("@F_MANV", F_MANV);
        para[2] = new SqlParameter("@F_HANHDONG", F_HANHDONG);
        try
        {
            connect.ExecuteQuery("tbNHATKYLOP_INSERT_LogXoaLOP", para);
        }
        catch { }
    }
    #endregion
}